import request from '@/utils/request'

//获取所有
export function getList(data) {
  return request({
    url: '/erp/customer/list',
    method: 'get',
    params: data,
  })
}

//获取所有
export function auditCustomers(data) {
  return request({
    url: '/erp/customer/approved',
    method: 'get',
  })
}

export function doAdd(data) {
  return request({
    url: '/erp/customer/register',
    method: 'post',
    data,
  })
}

//修改
export function doEdit(data) {
  return request({
    url: '/erp/customer/update',
    method: 'put',
    data,
  })
}

//删除
export function doDelete(data) {
  return request({
    url: '/erp/customer/delete/' + data,
    method: 'delete',
  })
}

//批改
export function doBatchUpdate(data) {
  return request({
    url: '/erp/customer/batchUpdate',
    method: 'put',
    data
  })
}

//上锁
export function doLock(data) {
  return request({
    url: '/erp/customer/lock/' + data,
    method: 'post',
  })
}

//解锁
export function doUnlock(data) {
  return request({
    url: '/erp/customer/unlock/' + data,
    method: 'post',
  })
}

//审批
export function doApproved(data) {
  return request({
    url: '/erp/customer/approved/' + data,
    method: 'put',
  })
}

//修改密码
export function doResetCustomerPwd(data) {
  return request({
    url: '/erp/customer/resetPwd',
    method: 'put',
    data
  })
}

//检查手机号码
export function doCheckPhoneNumber(data) {
  return request({
    url: '/erp/customer/checkPhoneNumber',
    method: 'get',
    params: data
  })
}

export function doCheckUserName(data){
  return request({
    url: '/erp/customer/checkUserName',
    method: 'get',
    params: data
  })
}

